<template>
    <div class="Home">
        <HomeTop :top_info = "home_top_info"></HomeTop>
        <Chart :chart_info = "home_chart"></Chart>
        <HomeTable :system_info = "home_sysytem"></HomeTable>
    </div>
</template>

<script>
import HomeTop from './homeTop/homeTop'
import Chart from '@/components/common/Chart/Chart'
import HomeTable from './HomeTable/HomeTable'

import {homeInfo} from '@/network/home/home'

export default {
    name:'Home',
    components:{
        HomeTop,
        Chart,
        HomeTable
    },
    data(){
        return{
            home_sysytem:'',
            home_chart:'',
            home_top_info:'',
            Mytoken:{
                token:this.$store.state.adminToken
            }
        }
    },
    created(){
        //创建完毕
        homeInfo(this.Mytoken).then( res => {
            this.home_sysytem = res.data.result.system
            this.home_chart = res.data.result.chart
            this.home_top_info = res.data.result.traffic[0]
            //console.log(res)
        }).catch( err => {
            console.log(err)
        })
    }
}
</script>

<style scoped>
.Home{
    padding: 15px;
    float:right;
    width: calc(100% - 350px);
    margin: 0 40px;
    margin-top: 110px;
    background: #F5F5FA;
    border-radius: 5px;
}
</style>